package com.xgc.erp.statistics.ctrl;

import com.jfinal.aop.Inject;
import com.jfinal.plugin.activerecord.Record;
import com.xgc.common.base.BaseController;
import com.xgc.common.vo.Grid;
import com.xgc.erp.order.sell.service.SellOrderService;
import com.xgc.erp.statistics.service.SellOrderStatisticsService;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

//@ControllerBind(path="/erp/statistics/sell/day")
public class SellDayReportController extends BaseController {
    @Inject
    SellOrderStatisticsService service;

    public void index() {
        render("index.html");
    }

    public void list(){
        String date = get("date",new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
        List<Record> list = service.sellOrderDayStatistics(date);
        renderJson(new Grid(list));
    }

}
